package com.zbf.shejimoshi2.代理模式.JDK;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/7/26  15:46
 * 描述:
 */
public class MyInvocationHandler30 implements InvocationHandler {

    //原始对象
    private Object obj;

    public MyInvocationHandler30(Object obj) {
        this.obj = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("-----之前  判断权限-----");
        Object invoke = method.invoke(obj, args);
        System.out.println("-----之后-----");
        return invoke;
    }
}
